# -*- coding:utf-8 -*- 
from flask import Flask,jsonify,render_template,request
from panduan import panduan

app = Flask(__name__)

@app.route("/", methods = ["GET"])
def hello() ->str:
	return "hello python web"

@app.route("/about", methods = ["GET"])
def hello_about() ->str:
	return "hello wangxin class"

@app.route("/project/<username>", methods = ["GET"])
def hello_project(username) ->str:
	return jsonify({"workman":"username","wangxin":"python"})

@app.route("/entry", methods = ["GET"])
def hello_entry() ->"html":
	return render_template("entry.html",the_title = "goodmorning workman")

@app.route("/search", methods = ["POST"])
def hello_login():
	zhanghao = request.form["zhanghao"]
	mima = request.form["mima"]
	a = panduan(zhanghao,mima)
	if a == "true":
		return "登入成功"
	else:
		return "登入失败"

@app.route("/bianse", methods= ["POST"])
def bianse():
	col = request.form["col"]
	return render_template('entry.html',color = col)

if __name__ == '__main__':
	app.run(debug=True)
